package com.ry.demo.concurrent.demo.designMode;

import java.util.List;

/**
 * 构造者模式
 */
public class NewOrderBuilder {

    public static void main(String[] args) {
        NewOrderBuilder newOrderBuilder = new NewOrderBuilder(null,null,null,null);
        Object fullOrderData = newOrderBuilder
                .buildOrder()
                .buildOrderItems()
                .build();

    }

    private Object createOrderRequest;

    private List<Object> productSkuList;

    private Object calculateOrderAmountDTO;

    private Object orderProperties;

    private Object fullOrderData;

    public NewOrderBuilder(Object createOrderRequest,
                           List<Object> productSkuList,
                           Object calculateOrderAmountDTO,
                           Object orderProperties) {
        this.createOrderRequest = createOrderRequest;
        this.productSkuList = productSkuList;
        this.calculateOrderAmountDTO = calculateOrderAmountDTO;
        this.fullOrderData = new Object();
        this.orderProperties = orderProperties;
    }

    /**
     * 构建OrderInfoDO对象
     * @return
     */
    public NewOrderBuilder buildOrder() {


        return this;
    }

    /**
     * 构建OrderItemDO对象
     * @return
     */
    public NewOrderBuilder buildOrderItems() {

        return this;
    }

    public Object build() {
        return this.fullOrderData;
    }

}
